<!DOCTYPE html>
<html lang="en" style="height:100%">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我的团队</title>

    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/swiper.css"/>
</head>
<style media="screen">
  .top-container{
    height: 20vh;
    top: 22%;
    overflow: visible;
    margin: 0;
    padding: 0;
  }
  .team_container{
    /*display: inline-block;*/
    float: left;
    width: 49%;
    text-align: center;
  }
  .team_container div{
    padding: 5px
  }
</style>
<body style="background-color:#F7F4F2">
<div id="blank" class="header">
    <div v-back.tapmode class="back"></div>
    <span class="title">我的团队</span>
</div>

<div id="app" class="top-container" v-cloak  style="margin-top:75px">
  <!-- <div  style="text-align:center;background-color:#F7F4F2;padding-bottom:8px;color:#333;font-size:14px" >
    你的团队信息还有<span id="time_circle"></span>更新
  </div> -->

  <!-- <div class="team_title">直接分享总人数</div>
  <div class="team_title">团队内总奶牛数</div>
  <div class="team_content ">{{user.team_count_member}}</div>
  <div class="team_content">{{user.team_count_cow}}</div> -->
  <div style="background:#ffffff">
  <div class="team_container">
    <div>直推总人数</div>
    <div>{{user.sub_member_count_d1}}</div>

  </div>
  <div class="team_container">
    <div >团队总人数</div>
    <div>{{user.sub_member_count_team}}</div>

  </div>
  <div class="team_container">
    <div>直推总牛数</div>
    <div>{{user.sub_cow_count_d1}}</div>

  </div>
  <div class="team_container">
    <div>团队总牛数</div>
    <div>{{user.sub_cow_count_team}}</div>

  </div>
  <div style="clear:both"></div>
</div>
</div>

</body>
<script src="../../script/api.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>
<script src="../../script/swiper.js"></script>
<script>

    var user;
    var vm;

    apiready = function () {
        setBSImg();
        new Vue({
            el: '#blank'
        });
        showProgress();
        var data = {
            member_id: getPrefs('member_id')
        };
        var callback = function (ret) {
            user = ret.content;
            console.log(JSON.stringify(user))
            initApp();
            api.parseTapmode();
        };
        pinet.post(URL.getUserinfo, data, callback);
        // TimeDown('time_circle');

        api.openFrame({
          name : 'frame_chat',
          url : './submembers.html',
          bgColor : 'f5f5f5',
          rect : {
            x: 0,
            y: 240,
            w: api.winWidth,
            h: 'auto'

          },
        });
        addListeners();
    };

    function initApp() {
        vm = new Vue({
            el: '#app',
            data: {
                imgPath:'../../image/',
                user:user,
                BSImg: {
                    big: Vue.BSImg == 'big',
                    small: Vue.BSImg == 'small'
                },
            },
            computed:{
            },
            methods:{

            }
        });
    }

    function addListeners() {
        api.addEventListener({
            name: 'viewappear'
        }, function () {
            onPageStart();
        });

        api.addEventListener({
            name: 'viewdisappear'
        }, function () {
            onPageEnd();
        });

        api.addEventListener({
            name: 'keyback'
        }, function () {
            onPageEnd();
            api.closeWin();
        });
    }

    function TimeDown(id) {
     //结束时间
     // var endDate = new Date(endDateStr);
     var endDate = new Date(new Date().setHours(0, 0, 0, 0)) / 1000+24*60*60;
     //当前时间
     var nowDate = (new Date())/1000;
     //相差的总秒数
     var totalSeconds = parseInt(endDate - nowDate);
     //天数
     var days = Math.floor(totalSeconds / (60 * 60 * 24));
     //取模（余数）
     var modulo = totalSeconds % (60 * 60 * 24);
     //小时数
     var hours = Math.floor(modulo / (60 * 60));
     modulo = modulo % (60 * 60);
     //分钟
     var minutes = Math.floor(modulo / 60);
     //秒
     var seconds = modulo % 60;
     //输出到页面
     document.getElementById(id).innerHTML =  hours + ":" + minutes + ":" + seconds;
     // var time_str = hours+':'+minutes+':'+seconds;
     // vm.time_str = time_str;
     //延迟一秒执行自己
     setTimeout(function () {
         TimeDown(id);
     }, 1000)
 }


</script>
</html>
